package com.longge;

public class CheckRecord {


    public boolean checkRecord(String s) {

        int countA = 0, countL = 0;
        char[] chars = s.toCharArray();
        if (chars[0]=='A') countA++;
        for (int i = 1; i < chars.length; i++) {
            if (chars[i] == 'L' && chars[i] == chars[i - 1]) {
                countL++;
            } else {
                countL = 0;
            }
            if (countL == 2) return false;
            if (chars[i] == 'A') {
                countA++;
            }
            if (countA == 2) return false;
        }
        return true;
    }
}
